import { forwardRef, useImperativeHandle,useState } from "react"
import Button from '@mui/material/Button';
import Dialog from '@mui/material/Dialog';
import DialogActions from '@mui/material/DialogActions';
import DialogContent from '@mui/material/DialogContent';
import DialogContentText from '@mui/material/DialogContentText';
import DialogTitle from '@mui/material/DialogTitle';



const ForgetDialog = forwardRef((props, ref) => {


    useImperativeHandle(ref, () => ({
        openDialog: () => {
            handleClickOpen()
        }
    }))

    const [open, setOpen] = useState(false);

    const handleClickOpen = () => {
        setOpen(true);
    };

    const handleClose = () => {
        setOpen(false);
    };

    return (
        <>
            <Dialog
                open={open}
                onClose={handleClose}
                aria-labelledby="alert-dialog-title"
                aria-describedby="alert-dialog-description"
            >
                <DialogTitle id="alert-dialog-title">
                   忘记密码啦？
                </DialogTitle>
                <DialogContent>
                    <DialogContentText id="alert-dialog-description">
                       联系管理员 QQ：1438775093
                    </DialogContentText>
                </DialogContent>
                <DialogActions>
                    <Button onClick={handleClose} autoFocus>
                        了解
                    </Button>
                </DialogActions>
            </Dialog>
        </>
    )
})

export default ForgetDialog